using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CMS.Domain.Entity;
using CMS.Infrastructrue.Persistence.Configuration.Base;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace CMS.Infrastructrue.Persistence.Configuration
{
    public class BlogConfiguration:BaseEntityConfiguration<Blog> 
    {
        public override void Configure(EntityTypeBuilder<Blog> builder)
        {
            base.Configure(builder);

            builder.ToTable("blog");

            builder.Property(x=>x.BlogId).HasColumnName("blog_id").HasColumnOrder(1);
            builder.Property(x=>x.BlogTitle).HasColumnName("blog_title").HasMaxLength(2000).HasColumnOrder(2);
            builder.Property(x=>x.BlogContent ).HasColumnName("blog_content ").HasMaxLength(200000).HasColumnOrder(3);
            builder.Property(x=>x.CateId ).HasColumnName("cate_id ").HasColumnOrder(4);
            builder.Property(x=>x.AuthorId ).HasColumnName("author_id ").HasColumnOrder(5);
            builder.Property(x=>x.AuthorAvatar).HasColumnName("author_avatar").HasColumnOrder(6);

        }
    }
}